package enterprise.web.tookit.user;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @since 22/11/2012
 * 
 * @author regis rocha
 * 
 * @description Classe de entidade para representar papeis de permissoes.
 * 
 */
@Entity(name = "user_roles")
@Table(name = "user_roles")
public class UserRole implements Serializable {

	/**
	 * serial version
	 */
	private static final long serialVersionUID = -7255428977575065253L;

	private Long id;

	private String roleName;

	private String descriptionRole;

	/**
	 * @return the id
	 */
	@Id
	@Column(name = "id_user_role")
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the roleName
	 */
	@Column(name = "role_name", nullable = false, length = 100)
	public String getRoleName() {
		return roleName;
	}

	/**
	 * @param roleName
	 *            the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	/**
	 * @return the descriptionRole
	 */
	@Column(name = "description_role", nullable = false, length = 255)
	public String getDescriptionRole() {
		return descriptionRole;
	}

	/**
	 * @param descriptionRole
	 *            the descriptionRole to set
	 */
	public void setDescriptionRole(String descriptionRole) {
		this.descriptionRole = descriptionRole;
	}

	@Override
	public String toString() {
		final StringBuilder toString = new StringBuilder();

		toString.append(" ID: " + this.id);
		toString.append(" , ROLE NAME: " + this.roleName);
		toString.append(" , DESCRIPTION ROLE: " + this.descriptionRole);

		return toString.toString();
	}

}
